package com.CNMedical.system.service.impl;

import java.util.List;

import com.diboot.core.service.impl.BaseServiceImpl;
import com.CNMedical.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.CNMedical.system.mapper.AppletKnowledgeTypeMapper;
import com.CNMedical.system.domain.entity.AppletKnowledgeType;
import com.CNMedical.system.service.IAppletKnowledgeTypeService;

import javax.annotation.Resource;

/**
 * 知识类型Service业务层处理
 * 
 * @author tang
 * @date 2023-03-28
 */
@Service
public class AppletKnowledgeTypeServiceImpl extends BaseServiceImpl<AppletKnowledgeTypeMapper, AppletKnowledgeType> implements IAppletKnowledgeTypeService
{
    @Resource
    private AppletKnowledgeTypeMapper appletKnowledgeTypeMapper;

     @Override
    public List<AppletKnowledgeType> getAllKnowledgeType() {
        return lambdaQuery().list();
    }

    /**
     * 查询知识类型
     * 
     * @param id 知识类型主键
     * @return 知识类型
     */
    @Override
    public AppletKnowledgeType selectAppletKnowledgeTypeById(Long id)
    {
        return appletKnowledgeTypeMapper.selectAppletKnowledgeTypeById(id);
    }

    /**
     * 查询知识类型列表
     * 
     * @param appletKnowledgeType 知识类型
     * @return 知识类型
     */
    @Override
    public List<AppletKnowledgeType> selectAppletKnowledgeTypeList(AppletKnowledgeType appletKnowledgeType)
    {
        return appletKnowledgeTypeMapper.selectAppletKnowledgeTypeList(appletKnowledgeType);
    }

    /**
     * 新增知识类型
     * 
     * @param appletKnowledgeType 知识类型
     * @return 结果
     */
    @Override
    public int insertAppletKnowledgeType(AppletKnowledgeType appletKnowledgeType)
    {
        appletKnowledgeType.setCreateTime(DateUtils.getNowDate());
        return appletKnowledgeTypeMapper.insertAppletKnowledgeType(appletKnowledgeType);
    }

    /**
     * 修改知识类型
     * 
     * @param appletKnowledgeType 知识类型
     * @return 结果
     */
    @Override
    public int updateAppletKnowledgeType(AppletKnowledgeType appletKnowledgeType)
    {
        appletKnowledgeType.setUpdateTime(DateUtils.getNowDate());
        return appletKnowledgeTypeMapper.updateAppletKnowledgeType(appletKnowledgeType);
    }

    /**
     * 批量删除知识类型
     * 
     * @param ids 需要删除的知识类型主键
     * @return 结果
     */
    @Override
    public int deleteAppletKnowledgeTypeByIds(Long[] ids)
    {
        return appletKnowledgeTypeMapper.deleteAppletKnowledgeTypeByIds(ids);
    }

    /**
     * 删除知识类型信息
     * 
     * @param id 知识类型主键
     * @return 结果
     */
    @Override
    public int deleteAppletKnowledgeTypeById(Long id)
    {
        return appletKnowledgeTypeMapper.deleteAppletKnowledgeTypeById(id);
    }
}
